package com.djmw.mouse.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 为提供树状结构表达的职位类别而设计的实体对象。
 * @author leo
 */
public class PositionTypeNode {

	private Long id;
	private String name;
	private int order;
	private List<PositionTypeNode> children;

	public PositionTypeNode(PositionType positionType) {
		this.id = positionType.id;
		this.name = positionType.getName();
		this.order = positionType.getOrder();
	}

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getOrder() {
		return order;
	}

	public List<PositionTypeNode> getSubPositionTypes() {
		return children;
	}

	public void addSubPositionType(PositionTypeNode subPositionType) {
		if (children == null) {
			children = new ArrayList<PositionTypeNode>();
		}
		children.add(subPositionType);
	}

}
